
  <?php
    
    $str_data1 = "[['Task', 'Goods manage']";
    $str_data = "";
    $name = "";
    foreach ($rows as $result)  
    {
            $str_data = $str_data.", ['".$result['name']."', ".$result['amount']."]";
    }
    $name = $str_data1.$str_data."]";
?>
<style type="text/css">
        .table
        {
            border-collapse: collapse;
                border: 1px solid #00CCCC;
        }

        .td
        {
            border-collapse: collapse;
           border: 1px solid #00CCCC;
        }
</style>
  <div id="content">
      <div class="box">
          <div class="heading">
              <h1 align="center"><?php echo $heading_title; ?></h1>
          </div>
          <div class="content">
              <div align=center class="reportChartContainer"> 
                <script type="text/javascript" src="https://www.google.com/jsapi"></script>
                <script type="text/javascript">
                google.load("visualization", "1", {packages:["corechart"]});
                google.setOnLoadCallback(drawChart);
                function drawChart() {
                    var data = google.visualization.arrayToDataTable(<?php echo $name?>);

                    var options = {title: 'Doanh thu theo các mặt hàng'};

                    var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
                    chart.draw(data, options);
                }
                </script>
               </div>
               <body onload="window.print()">    
               <div align=center id="chart_div" style="width: 900px; height: 500px;"></div>
               </body>
               <table cellpadding='0' cellspacing='0' width='100%' border='0' class="table">

                    <tr bgcolor="Gainsboro" height='20'>
                        <td class="td"><p align="center"><b><?php echo $STT; ?></b>
                        </td>
                        <td class="td"><p align="center"><b><?php echo $goods_name; ?></b>
                        </td>

                        <td class="td"><p align="center"><b><?php echo $Doanhthu; ?></b>
                        </td>
                    </tr>
                    <?php
                        $i = 0;
                        foreach ($rows as $result)  
                        {
                                $i=$i + 1;
                                echo " <tr height='20'>";
                                echo "<td class='td'><p align='center'><b>".$i."</b>";
                                echo "</td>";
                                echo "<td class='td'><p align='center'>
                                    <b>".$result['name']."</b>";
                                echo "</td>";
                                echo "<td class='td'><p align='center'><b>".$result['amount']."</b>"; 
                                echo "</td>";
                        }

                    ?>
               </table>            
          </div>
      </div>
  </div>




